March 22, 2012

Tool Measuring with Renishaw TS27R

Primary Services

M51 - Measure height

Calls on the set_h.cnc and O8851.cnc macros to measure the height offset for the specified tool, or for the current tool if no tool is specified.

An approximate diameter should be entered in the tool's diameter offset before calling M51. If that diameter is less than 0.400", then length will be measured on centerline, with the spindle stopped. If the preset diameter is 0.400" or more, then length will be measured off-center by the tool radius, and with the spindle turning CCW.

For large drills or ball end mills, the diameter should be preset to zero so that measurement will take place on centerline.

M52 - Measure height and diameter

Calls on the set_hd.cnc, O8851.cnc and O8852.cnc macros to measure the height offset and diameter offset for the specified tool, or for the current tool if no tool is specified.

An approximate diameter should be entered in the tool's diameter offset before calling M52. It is used for length measurement as described under the M51 code.

The control also uses the preset diameter in diameter offset measurement: it will add the nominal tool radius when calculating how far to move the Y axis in front and in back of the tool detector, in order to clear before moving in to measure diameter.

For drills and ball end mills larger than about 1/2" (13mm) you will need to call the set_hd.cnc or O8852 macro directly, in order to override the side clearance and Z depth for diameter measurement.

M53 - Check for tool breakage

Calls on the chk_brk.cnc macro to check a previously measured tool for breakage.

This routine will rapid up and over the detector; move quickly down to within 1mm of the detector; then move down until the tool touches the detector or reaches a position 0.2mm below the expected contact point. If the tool reaches that position without contact, then it is presumed broken and the CNC program cycle is canceled.

If the tool is okay, then this routine rapids back up, over, and down to the previous location. Most G code modal conditions (coordinate system, feedrate, movement mode, spindle speed) are restored. However, spindle rotation is not restarted, and canned cycles (e.g. drilling, boring, tapping) are not restored. The CNC program will have to repeat the M3 code and, if needed, canned cycle code after calling M53.

Secondary Services

set_h.cnc - Measure height

Called from M51; see M51 description for details.

If set_h.cnc is to be called directly from a CNC program, it will need to be called by its full path name. E.g.

G65 "c:\cnc10\set_h.cnc" T10

set_hd.cnc - Measure height and diameter

Called from M52; see M52 description for details.

If set_hd.cnc is to be called directly from a CNC program, it will need to be called by its full path name. E.g.

G65 "c:\cnc10\set_hd.cnc" T10

SET_HD accepts an optional Z position, to override the default diameter measuring depth; and an optional R distance, to override the default radial clearance when positioning the tool in front and in back of the detector, prior to measuring diameter. These values are needed when measuring larger drills and ball mills.

For example, if you are measuring height and diameter for a 1" ball end mill, you will want to preset the diameter offset to zero so that length measurement is done on centerline. But you would then need to tell SET_HD that it needs at least a half inch extra clearance to get the tool in front or back of the detector (remember, SET_HD would otherwise think your 1" diameter tool has zero diameter). You would also need to tell SET_HD to go down at least a half inch to get a valid diameter measurement. E.g.

G10 D12 R0  ; preset tool 12 diameter to zero
G65 "c:\cnc10\set_hd.cnc" T12 R0.6 Z-0.6   ; measure height and diameter

If you do not override R, then the default radial clearance is 4mm plus half of the tool's preset diameter (leaving approximately 4mm clearance).

If you do not override Z, then the default Z depth for measuring tool diameter is with the tool tip 4mm below the top of the tool detector stylus (i.e. about half way down the side of the stylus).

chk_brk.cnc - Check for tool breakage

Called from M53; see M53 description for details.

If chk_brk.cnc is to be called directly from a CNC program, it will need to be called by its full path name. E.g.

G65 "c:\cnc10\chk_brk.cnc" T10

Underlying Routines

O8851.cnc - Measure height offset

Called through SET_H and SET_HD macros; may also be called directly with G65.

O8852.cnc - Measure diameter offset

Called through SET_HD macro; may also be called directly with G65.

O8799.cnc - Set unit conversion variables

Called from other routines, in order to set the following variables

#29 = multiplier to convert millimeters to user units (user units per millimeter)

#31 = multiplier to convert inches to user units (user units per inch)

#33 = multiplier to convert default machine units to user units

If a routine wants to execute a move with a distance or feedrate known in millimeters, it should multiply by #29. E.g. to move X incrementally 2mm at 4mm/min:

G1 G91 X[2.0*#29] F[4.0*#29]

If a routine wants to execute a move with a distance or feedrate known in inches, it should multiply by #31. E.g. to move X incrementally by the amount stored in variable #152 (which is always in inches) at 10 in/min:

G1 G91 X[#152*#31] F[10.0*#31]

Files

All the macro files for these services are located in the /cncroot/c/cnc10 directory, which is displayed in the Centroid software as c:\cnc10. Files are:

cnc10.m51
cnc10.m52
cnc10.m53
set_h.cnc
set_hd.cnc
chk_brk.cnc
O8799.cnc
O8851.cnc
O8852.cnc

Calibration

Diameter measurement depends on a calibrated stylus diameter, stored in static user variable #152. This variable value is saved on the hard drive in the file cnc10m.job, along with other job setup information (current WCS, name of current job, part count, whether machine home is set, etc.). In the unlikely event cnc10m.job is corrupted or deleted, the control will display a warning on startup (e.g. "Error loading job information, using defaults"). In that case all static variables, including #152, will be reset to zero.

You can set #152 using the MDI prompt. To set it to a known value, enter a simple assignment. E.g.

#152 = 0.5

To change it by some amount, without necessarily knowing its value, enter an assignment with addition or subtraction. E.g.

#152 = #152 - 0.0015

To display the current value stored in #152, you have to open a command prompt and use the cnc10conv utility to display the contents of the cnc10m.job file. When done, use the exit command to close the command prompt E.g.

Alt-F6
/cncroot/c/cnc10> cnc10conv -dj
cnc10conv v. 2.70 - Centroid configuration file utility
cnc10 v. 2.70 job info file
Last job file: c:\cnc10\ncfiles\test.cnc
Part count:    0                        Edge Finder Diameter: 0.1239
[...]
Saved user variable values:
#150 =    0.0000
#151 =    0.0000
#152 =    0.4990
#153 =    0.0000
#154 =    0.0000
[...]

/cncroot/c/cnc10> exit

The stylus diameter you store in #152 should always be in inches, even when the control has been changed over to run in millimeters.

To determine the necessary value or adjustment for #152, simply use M52 or set_hd.cnc to measure the height and diameter of a tool with a precise known diameter (e.g. a length of drill rod, which you have confirmed has zero runout in the tool holder). Compare the resulting diameter stored in the offset library with the known tool diameter. If the measured diameter is less than the actual diameter, you need to make #152 smaller by the amount of the error. If the measured diameter is more than the actual diameter, you need to make #152 larger by the amount of the error.